package com.ghck.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ghck.server.dao.provider.DiseaseKeywordProvider;
import com.ghck.server.model.DiseaseKeyword;
import com.ghck.server.model.query.DiseaseKeywordQuery;
/**
 * 疾病搜索热词表  <br>
 * t_disease_keyword <br>
 * v1.0 2016-05-01
 */
 public interface DiseaseKeywordMapper {
 	
 	/**
 	*根据id删除 疾病搜索热词表
 	*/
 	@Delete("delete from t_disease_keyword where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 疾病搜索热词表
 	*/
 	@InsertProvider(method="batchInsert",type=DiseaseKeywordProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends DiseaseKeyword> diseaseKeywords);
 	
 	/**
 	* 新增 疾病搜索热词表
 	*/
 	@InsertProvider(method="insert",type=DiseaseKeywordProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(DiseaseKeyword domain);
 
 	
 	/**
 	*更新 疾病搜索热词表
 	*/
 	@UpdateProvider(method="update",type=DiseaseKeywordProvider.class)
 	public Integer update(DiseaseKeyword domain);
 	
 	/**
 	*根据ID查询 疾病搜索热词表
 	*/
	@Select("select * from t_disease_keyword where id=#{id}")
	public DiseaseKeyword findById(Integer id);
	
	/**
 	*通过query 查询 疾病搜索热词表
 	*/
 	@SelectProvider(method="findByQuery",type=DiseaseKeywordProvider.class)
 	public List<DiseaseKeyword> findByQuery(DiseaseKeywordQuery query);
 	
 	/**
 	*通过query 查询 疾病搜索热词表
 	*/
 	@Select("select * from t_disease_keyword where in_used = 1")
 	public List<DiseaseKeyword> findAll();
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=DiseaseKeywordProvider.class)
 	public Integer countByQuery(DiseaseKeywordQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=DiseaseKeywordProvider.class)
 	public List<DiseaseKeyword> findByIds(List<Integer> ids);
 	

}	